#include <QApplication>
#include <QPushButton>
#include <QLineEdit>
#include <QDialog>

//QSpinBox
int main(int argc , char **argv)
{
	/* 根据构造函数 构建qt应用程序对象 */
	QApplication app(argc , argv);
	/* 创建父窗口 */
	QDialog *parent = new QDialog();
	/* 创建父窗口大小 */
	parent->resize(400,400);
	/* 创建一个QLineEdit对象，并将其挂靠到父窗口 */
	QLineEdit *lineEdit1 = new QLineEdit(parent);
	QLineEdit *lineEdit2 = new QLineEdit(parent);
	lineEdit1->move(200,100);
	lineEdit2->move(200,150);
	/* 创建一个QSpinBox对象，并将其挂靠到父窗口 */
	QPushButton *btn1 = new QPushButton(parent);
	QPushButton *btn2 = new QPushButton(parent);
	btn1->move(100,200);	
	btn2->move(300,200);
	btn1->setText("Login");
	btn2->setText("Cancel");
	/* 创建事件关联 */
	QObject::connect(btn2, SIGNAL(clicked()),
                  parent,  SLOT(close()));
	parent->show();	
	return app.exec();
}
